/*! \file ResourceManager.cpp
 *	\brief 
 *
 *	created:	2010/07/27
 *	created:	27:7:2010   17:22
 *	filename: 	C:\src\tactics-engine\libs\rm\ResourceManager.cpp
 *	file path:	C:\src\tactics-engine\libs\rm
 *	file base:	ResourceManager
 *	file ext:	cpp
 *	author:		Vitalii Trubchaninov
 *				venngraydog@gmail.com
 */
#include "resource_manager/stdafx.h"
#include "resource_manager/ResourceManager.h"

#include <core/assert.h>

namespace tt{
namespace rm{

static ScopedPtr<ResourceManager> gs_instance;

ResourceManager::ResourceManager()
{

}

ResourceManager::~ResourceManager()
{

}

void ResourceManager::CreateInstance(ResourceManager* rm)
{
	ttAssert(gs_instance == NULL);
	gs_instance.reset(rm);
}

void ResourceManager::DestroyInstance()
{
	gs_instance.reset();
}

ResourceManager& ResourceManager::GetInstance()
{
	return *gs_instance;
}

//////////////////////////////////////////////////////////////////////////
SharedPtr<io::BaseIStream> ResourceManager::GetStream( const String& streamName )
{
	return OnGetStream(streamName);
}

} //namespace rm

RM_API rm::ResourceManager& ttResourceManager()
{
	return rm::ResourceManager::GetInstance();
}

} //namespace tt